package com.qfedu.openplateform.manager.service.impl;

/**
 * TODO
 *
 * @author DELL
 * @date 2021-10-27 19:46
 */

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qfedu.openplateform.manager.dao.UserTokenMapper;
import com.qfedu.openplateform.manager.entity.UserToken;
import com.qfedu.openplateform.manager.service.UserTokenService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserTokenServiceImpl implements UserTokenService {

    @Resource
    private UserTokenMapper userTokenMapper;


    @Override
    public PageInfo<UserToken> table(UserToken userToken, Integer page, Integer limit) {

        PageHelper.startPage(page, limit);
        return new PageInfo<>(userTokenMapper.table(userToken));
    }

    @Override
    public void deleteToken(int[] ids) {
        for (int id : ids){
            userTokenMapper.deleteTokenById(id);
        }


    }
}
